package com.sbtr.business.feature.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import java.io.Serializable;

import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;
import lombok.EqualsAndHashCode;
    import lombok.experimental.Accessors;
import io.swagger.annotations.ApiModel;


/**
 * 属性生成字段列表 实体类
 *
 * @author dgl
 * @since 2023-04-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("f_fe_attributecreate_rule")
@ApiModel(value="FeAttributecreateRule对象")
public class FeAttributecreateRule extends Model<FeAttributecreateRule> {

    @ApiModelProperty(value = "id")
    @TableId(value = "id")
    private Long id;

    @ApiModelProperty(value = "函数来源:来自数据字典（内置函数、自定义函数）")
    private String funsource;

    @ApiModelProperty(value = "函数类型：仅仅“内置函数”有“函数类型”；自定义函数只有四则运算；类型包括（数值型、文本型、日期型三种）")
    private String type;

    @ApiModelProperty(value = "函数：数值型（二次方根、取绝对值、求正弦、四舍五入、随机数生成）、文本型（去除前后空格、移除左边空格、移除右边空格）、日期型（提取年份、提取月份、提取季节等）")
    private String function;

    @ApiModelProperty(value = "所属处理链id：特征处理链f_fe_operator表的ID")
    private Long processingId;

    @ApiModelProperty(value = "新属性名称")
    private String newfield;

    @ApiModelProperty(value = "原始数据字段名，多个：fe_datafield表字段名（当仅仅适用内置函数满足条件）")
    private String fieldnames;

    @ApiModelProperty(value = "自定义公式：各个属性及常数之间的四则运算（仅仅适用个人自定义函数）")
    private String formula;

    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")// 后台传数据到前台
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") //前台传数据到后台
    private Date createTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
